package com.example.utils;
/*
 * @Author: hx
 * @CreateTime: 2022/3/3 10:33
 * @Description: 获取随机类头像
 * */

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class ImageUtils {
    public static List<String> photos;
    static {
        photos = new ArrayList<>();
        photos.add("https://z3.ax1x.com/2021/07/19/W8HFW4.jpg");
        photos.add("https://z3.ax1x.com/2021/07/19/W8HiYF.jpg");
        photos.add("https://z3.ax1x.com/2021/07/19/W8HPFU.jpg");
        photos.add("https://z3.ax1x.com/2021/07/19/W8HEl9.jpg");
        photos.add("https://z3.ax1x.com/2021/07/19/W8HASJ.jpg");
        photos.add("https://z3.ax1x.com/2021/07/19/W8HZO1.jpg");
        photos.add("https://z3.ax1x.com/2021/07/19/W8HVyR.jpg");
        photos.add(" https://z3.ax1x.com/2021/07/19/W8HpwV.jpg");
        photos.add(" https://z3.ax1x.com/2021/07/19/W8H9oT.jpg");
    }

    /**
     * 从随机头像中选取一个
     * @return
     */
    public static String getPhoto(){
        int i = new Random().nextInt(photos.size());
        return photos.get(i);
    }
}
